﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharedLib.MessageFramework.Handlers;

namespace SharedLib.MessageFramework.Messages
{
    public class AsyncActionAppMessage : AppMessageGeneric<Action<AsyncActionAppMessage>, object>
    {
        public override Type Handler
        {
            get { return typeof(AsyncActionAppMessageHandler); }
        }
        string _handlerUID;
        public override string HandlerUID
        {
            get
            {
                if(string.IsNullOrEmpty(_handlerUID)) return base.HandlerUID;
                return _handlerUID;
            }
        }

        public AsyncActionAppMessage(object sender, Action<AsyncActionAppMessage> action, string handlerUID, IAppMessage parentMessage = null)
            : base(sender, action, parentMessage)
        {
            if (!string.IsNullOrEmpty(handlerUID))
            {
                _handlerUID = handlerUID;
            }
        }
    }
}
